import request from '@/utils/request'

// 查询公寓管理列表
export function listApartment(query) {
  return request({
    url: '/apartment/apartment/list',
    method: 'get',
    params: query
  })
}

// 查询公寓管理详细
export function getApartment(apartmentId) {
  return request({
    url: '/apartment/apartment/' + apartmentId,
    method: 'get'
  })
}

// 新增公寓管理
export function addApartment(data) {
  return request({
    url: '/apartment/apartment',
    method: 'post',
    data: data
  })
}

// 修改公寓管理
export function updateApartment(data) {
  return request({
    url: '/apartment/apartment',
    method: 'put',
    data: data
  })
}

// 删除公寓管理
export function delApartment(apartmentId) {
  return request({
    url: '/apartment/apartment/' + apartmentId,
    method: 'delete'
  })
}
// 获取省份列表
export function listProvinces() {
  return request({
    url: '/apartment/region/provinces',
    method: 'get'
  })
}

// 获取城市列表
export function listCities(provinceId) {
  return request({
    url: `/apartment/region/cities/${provinceId}`,
    method: 'get'
  })
}
